﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title><%=Session["AdminPortalTitle"]%></title>
    <link href="<%=Session["ActiveTheme"]%>/default.css" rel="stylesheet" type="text/css" />
    <link type="text/css" rel="stylesheet" href="javascripts/dhtmlgoodies_calendar/dhtmlgoodies_calendar.css?random=20051112" media="screen"></LINK>
    <link rel="STYLESHEET" type="text/css" href="ThirdParties/dhtmlx/dhtmlxTree/codebase/dhtmlxtree.css">
	<script src="ThirdParties/dhtmlx/dhtmlxTree/codebase/dhtmlxcommon.js"></script>
	<script src="ThirdParties/dhtmlx/dhtmlxTree/codebase/dhtmlxtree.js"></script>
    <script src="scripts/jquery-1.4.1.min.js"></script>
</head>

<body>
    <script language=javascript>
        function setDateTime()
        {
            document.getElementById("divPanelDateTime").innerHTML=Portal.Environment.Environments.GetCurrentDateTime().value;
            //setTimeout("setDateTime()",1000);
        }
    
        function ClientResetLookUp(HiddenId,DisplayId)
        {
            ConfirmMsg=Portal.Environment.Environments.GetConfirmDeleteMsg().value;
            if(confirm(ConfirmMsg)==false)return;
            document.getElementById(HiddenId).value="";
            document.getElementById(DisplayId).innerHTML=Portal.Environment.Environments.GetTextForLookUp().value;
        }

        function TurnOffReminder(Id) {
            if(confirm('Bạn đã chắc chắn tắt cảnh báo này chưa?')==false)return;
            rValue=WorkFlowLibrary.Reminder.ServerSideTurnOffReminder(Id).value;
            document.getElementById("divReminder").innerHTML=rValue;
        }

        function ClientChangeActiveSite() {
            selectSiteIndex = document.getElementById("drpSelectSite").selectedIndex;
            selectSite = document.getElementById("drpSelectSite").options[selectSiteIndex].value;
            rValue = Portal.Environment.Environments.SetActiveSite(selectSite).value;
            alert(rValue);
            if (rValue.indexOf("ERROR") == -1) {
                window.open("default.aspx", "_self");
            }
        }
    </script>

    <a id=top></a>

    <form id="frmMain" runat="server" enctype="multipart/form-data">
    <div id="layout_wrapper">
    <div id="layout_edgetop"></div>
    <div id="layout_container">
	<div id="site_title">
		<h1 class="left"><%=Session["AdminPortalTitle"]%></h1>
        <br><h2 class="rightHeading"><asp:PlaceHolder ID="placeHolderLoginUser" runat="server"></asp:PlaceHolder></h2>
		<div class="clearer">&nbsp;</div>
	</div>
	<div id="top_separator"></div>
	<div id="navigation">
		<div id="tabs">
			<asp:PlaceHolder ID="placeHolderMenuBar" runat="server"></asp:PlaceHolder>
			<div class="clearer">&nbsp;</div>
		</div>
	</div>

	<div class="spacer h5"></div>

	<div id="main">
		<div class="left" id="main_left">
			<div id="main_left_content">
				<div class="post">
<div class="pagenavigation">
					<div class="pagenav">
						<div class="left"><div id=divPanelDateTime class=cssDateTimePanel></div></div>
						<div class="right"></div>
						<div class="clearer">&nbsp;</div>
					</div>
					<div class="pagenav_bottom"></div>
				</div>
					<div class="post_body">
				     <asp:PlaceHolder ID="placeHolderLeftInfoTop" runat="server"></asp:PlaceHolder>		
					 <asp:PlaceHolder ID="placeHolderContent" runat="server"></asp:PlaceHolder>
						
					</div>

					<div class="post_bottom"></div>

				</div>
		
				<div class="pagenavigation">
					<div class="pagenav">
						<div class="left"><a href="#top">&laquo; Top</a></div>
						<div class="right"></div>
						<div class="clearer">&nbsp;</div>
					</div>
					<div class="pagenav_bottom"></div>
				</div>
                <asp:PlaceHolder ID="placeHolderLeftInfoBottom" runat="server"></asp:PlaceHolder>
			</div>
		</div>
		<div class="right" id="main_right">
			<div id="sidebar">
                <asp:PlaceHolder ID="placeHolderLeft" runat="server"></asp:PlaceHolder>
			</div>
		</div>
		<div class="clearer">&nbsp;</div>
        
        <div id="divReminder"></div>
	</div>
    <div class=info_footer><asp:PlaceHolder ID="placeHolderInfoFooter" runat="server"></asp:PlaceHolder></div>
	<div id="footer">
		<div class="left"></div>
		<div class="right"><asp:PlaceHolder ID="placeHolderFooter" runat="server"></asp:PlaceHolder></div>
		<div class="clearer">&nbsp;</div>
	</div>
</div>
    <div id="layout_edgebottom"></div>
</div>

<script type="text/javascript">
    function setLoadReminder() {
        ReminderText = WorkFlowLibrary.Reminder.GetReminder().value;
        document.getElementById("divReminder").innerHTML = ReminderText;
        setTimeout("setLoadReminder()", 1000000);
    }

    function setLoadChatUser() {
        ActiveChat = Portal.Environment.Environments.GetActiveChat().value;
        if (ActiveChat == 1) {
            UserText = Portal.Environment.ChatServices.GetLoggedInUsers().value;
            document.getElementById("divUsers").innerHTML = UserText;
            setTimeout("setLoadChatUser()", 120000);
        }
    }

    function detectRequestChat() {
        Id = Portal.Environment.ChatServices.CheckHasInCommingChat().value;
        if (Id != null) {
            window.open("PlugInServices/Chat/PrivateChat.aspx?r=1&RoomId=1&ChatWithUserId=" + Id, "_blank");
            setTimeout("detectRequestChat()", 120000);
        }
    }

    setDateTime();
    ActiveChat = Portal.Environment.Environments.GetActiveChat().value;
    if (ActiveChat == 1) {
        setLoadChatUser();
        detectRequestChat();
    }
    AutoReminder = Portal.Environment.Environments.GetAutoReminder();
    if (AutoReminder == 1) {
        setLoadReminder();
    }
</script>   

<script type="text/javascript">
    function ChangePassword()
    {
        alert("Chức năng này đang được xây dựng! Xin vui lòng quay lại sau!");
    }
</script>

    </form>
</body>
</html>
